import request from '@/utils/request';

// 查询阿波罗数据源列表
export function listApolloDatasource(query) {
  return request({
    url: '/tool/apolloDatasource/list',
    method: 'get',
    params: query,
  });
}

// 查询阿波罗数据源详细
export function getApolloDatasource(datasourceId) {
  return request({
    url: '/tool/apolloDatasource/' + datasourceId,
    method: 'get',
  });
}

// 新增阿波罗数据源
export function addApolloDatasource(data) {
  return request({
    url: '/tool/apolloDatasource',
    method: 'post',
    data: data,
  });
}

// 修改阿波罗数据源
export function updateApolloDatasource(data) {
  return request({
    url: '/tool/apolloDatasource',
    method: 'put',
    data: data,
  });
}

// 删除阿波罗数据源
export function delApolloDatasource(datasourceId) {
  return request({
    url: '/tool/apolloDatasource/' + datasourceId,
    method: 'delete',
  });
}

// 脚本恢复阿波罗数据源
export function scriptRecover(data) {
  return request({
    url: '/tool/apolloDatasource/scriptRecover',
    method: 'put',
    data: data,
  });
}
